/*
 * Copyright (c) 2024 Allwinner Device Co., Ltd.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef T527_CODEC_IMPL_H
#define T527_CODEC_IMPL_H

#include "audio_codec_if.h"
#include "securec.h"
#include "audio_control.h"
#include "audio_parse.h"
#include "osal_mem.h"
#include "osal_time.h"

int32_t T527CodecHalSysInit(struct CodecData *codeData);
int32_t T527CodecImplRegmapWrite(uint32_t reg, uint32_t val);
uint32_t T527CodecImplRegmapRead(uint32_t reg, uint32_t *val);
int32_t T527CodecRegBitsRead(struct AudioMixerControl *regAttr, uint32_t *regValue);
int32_t T527CodecRegBitsUpdate(struct AudioMixerControl regAttr);
int32_t T527CodecRegDefaultInit(struct AudioRegCfgGroupNode **regCfgGroup);

int32_t T527CodecImplHwParams(struct AudioRegCfgGroupNode **regCfgGroup, enum AudioStreamType streamType, 
            enum AudioFormat format, uint32_t channels, uint32_t rate);
int32_t T527CodecImplTrigger(struct AudioRegCfgGroupNode **regCfgGroup,
                             enum AudioStreamType streamType, bool enable);
int32_t T527CodecImplShutdown();

int32_t T527CodecAiaoSetCtrlOps(const struct AudioKcontrol *kcontrol,
    const struct AudioCtrlElemValue *elemValue);
int32_t T527CodecAiaoGetCtrlOps(const struct AudioKcontrol *kcontrol,
    struct AudioCtrlElemValue *elemValue);

#endif /* T527_CODEC_IMPL_H */